<!DOCTYPE html>
<html>
<head>
{include file="common/head"}
</head>
{include file="common/header"}

<script type="text/javascript">
var CF = {
	URL: {
		UP_ASK: '{:url('wendasns/common/upload',['type'=>'question'])->domain(true)}',
		UP_ANS: '{:url('wendasns/common/upload',['type'=>'answer'])->domain(true)}',
		USER_CARD: '{:url('wendasns/api/userinfo')->domain(true)}',
		COMMENT_LIST: '{:url('wendasns/answer/comment')->domain(true)}',
		COMMENT: '{:url('wendasns/comment/post')->domain(true)}',
	}
};
</script>
<body>
<div class="layui-container mtop">
  <div class="layui-row layui-col-space15">
  
  	<div class="layui-col-md12">{:load_advert('QuestionListCentre')}</div>
  
    <div class="layui-col-md9">
      <div class="layui-card">
        
        <div class="layui-card-body">
          <a href="{:url('wendasns/question/index',[],false)}"><span class="wds-badge {if $categoryname eq 'all'}{else}wds-bg-gray{/if}">全部</span></a>
          {volist name="category" id="v" key="k"}
          	{if $v.list}{volist name="v.list" id="item"}<a href="{if $type eq 'new'}{:url('wendasns/question/index',['cname'=>$item.dir_name],false)}{else}{:url('wendasns/question/index',['cname'=>$item.dir_name,'type'=>$type],false)}{/if}"><span class="wds-badge {if $v.dir_name eq $item.dir_name}{else}wds-bg-gray{/if}">{$item.name}</span></a>{/volist}
          	
          	{/if}
          	{if $k<count($category)}<hr>{/if}
          {/volist}
        </div>
      </div>
      <div class="layui-card">
        
        <div class="layui-card-list">
          <div class="layui-tab layui-tab">
            <ul class="layui-tab-title">
              <li class="{if $type=='new'}layui-this{/if}"><a href="{if $categoryname eq 'all'}{:url('wendasns/question/index',[],false)}{else}{:url('wendasns/question/index',['cname'=>$categoryname],false)}{/if}"><i class="fas fa-newspaper"></i> 最新</a></li>
              <li class="{if $type=='hot'}layui-this{/if}"><a href="{:url('wendasns/question/index',['cname'=>$categoryname,'type'=>'hot'],false)}"><i class="fas fa-hot-tub"></i> 热门</a></li>
              <li class="{if $type=='unsolved'}layui-this{/if}"><a href="{:url('wendasns/question/index',['cname'=>$categoryname,'type'=>'unsolved'],false)}"><i class="fas fa-comments"></i> 未解决</a></li>
              <li class="{if $type=='unanswer'}layui-this{/if}"><a href="{:url('wendasns/question/index',['cname'=>$categoryname,'type'=>'unanswer'],false)}"><i class="fas fa-question-circle"></i> 未回复</a></li>
              <li class="{if $type=='solved'}layui-this{/if}"><a href="{:url('wendasns/question/index',['cname'=>$categoryname,'type'=>'solved'],false)}"><i class="fas fa-check-square"></i> 已解决</a></li>
            </ul>
            <div class="layui-tab-content">
              <div class="layui-tab-item layui-show">
                <div class="question-list">
                
                {volist name=":load_question('top')" id="item"}
				<section class="question-list-item">
                  <div class="qa-rank">
                    {if $item.answer==0}
					<div class="answers">
						{$item.answer}<small>未回</small>
					</div>
                    {/if}
                     {if $item.answer>0}
                    
                      {if $item.adopt_id>0}
                    <div class="answers answered solved">
						{$item.answer}<small>解决</small>
					</div>
                    {else}
                    <div class="answers answered">
						{$item.answer}<small>已回</small>
					</div>
                      {/if}
                    {/if}
                    
								        <div class="views layui-hide-xs">
								            {$item.visits} <small>浏览</small>
								        </div>
								    </div>
                  <div class="summary">
                	<span class="layui-badge layui-bg-green" style="margin-right: 5px;"><i class="layui-icon layui-icon-top" style="font-size: 12px;"></i> 置顶</span>{if $item.recommend}<span class="layui-badge" style="margin-right: 5px;"><i class="layui-icon layui-icon-fire" style="font-size: 12px;"></i> 推荐</span>{/if}<a href="{:url('wendasns/question/show',$item)}" class="lista">{$item.title}</a>{if $item.tags}<div class="tags">{volist name=":explode(',',$item.tags)" id="tags"} <a href="{:url('wendasns/topic/show',['tags'=>$tags])}" class="tag">{if $item.icon}<img src="{$item.icon}" alt="{$tags}">{/if}{$tags}</a>{/volist}</div>{/if}
                <!--<p><font color="#999">{:strip_tags($item.content)}</font></p>-->
                 
                <div class="ask-userinfo" style="margin-bottom: 1px;">
                	<a href="{:url('wendasns/home/index',['id'=>$item.user_id],false)}" class="userinfo-show portrait-xs" style="margin-right: 10px;" data-uid="{$item.user_id}">{:portrait($item.user_id)}{$item.users.username}</a>  <span style="font-size: 14px;color: #bbb;"><i class="layui-icon layui-icon-date"></i>  {:range_time($item.create_time)}</span> {if $item.answer==0}<a href="{:url('wendasns/question/show',$item)}#answer" class="pportrait-xs"><span style="color: #bbb;font-size: 12px; float: right;"><i class="layui-icon layui-icon-reply-fill" style="font-size: 20px; margin-right: 5px;"></i>回复</span></a> {else}<span style="color: #bbb;font-size: 12px; float: right;">贡献{volist name="$item->answers()->limit(3)->select()" id="vars"}<a href="{:url('wendasns/home/index',['id'=>$vars.user_id],false)}" class="pportrait-xs">{:portrait($vars.user_id)}</a>{/volist}</span>{/if}
                	
              </div>
                    </div>
                  </section>
                {/volist}
                
                {:hook('question_list_item')}
                
                {volist name="logs" id="item"}
				<section class="question-list-item">
                  <div class="qa-rank">
                    {if $item.answer==0}
					<div class="answers">
						{$item.answer}<small>未回</small>
					</div>
                    {/if}
                     {if $item.answer>0}
                    
                      {if $item.adopt_id>0}
                    <div class="answers answered solved">
						{$item.answer}<small>解决</small>
					</div>
                    {else}
                    <div class="answers answered">
						{$item.answer}<small>已回</small>
					</div>
                      {/if}
                    {/if}
                    
								        <div class="views layui-hide-xs">
								            {$item.visits} <small>浏览</small>
								        </div>
								    </div>
                  <div class="summary">
                	{if $item.recommend}<span class="layui-badge" style="margin-right: 5px;"><i class="layui-icon layui-icon-fire" style="font-size: 12px;"></i> 推荐</span>{/if}<a href="{:url('wendasns/question/show',$item)}" class="lista">{$item.title}</a>{if $item.tags}<div class="tags">{volist name=":explode(',',$item.tags)" id="tags"} <a href="{:url('wendasns/topic/show',['tags'=>$tags])}" class="tag">{if $item.icon}<img src="{$item.icon}" alt="{$tags}">{/if}{$tags}</a>{/volist}</div>{/if}
                <!--<p><font color="#999">{:strip_tags($item.content)}</font></p>-->
                 
                <div class="ask-userinfo" style="margin-bottom: 1px;">
                	<a href="{:url('wendasns/home/index',['id'=>$item.user_id],false)}" class="userinfo-show portrait-xs" style="margin-right: 10px;" data-uid="{$item.user_id}">{:portrait($item.user_id)}{$item.users.username}</a>  <span style="font-size: 14px;color: #bbb;"><i class="layui-icon layui-icon-date"></i>  {:range_time($item.create_time)}</span> {if $item.answer==0}<a href="{:url('wendasns/question/show',$item)}#answer" class="pportrait-xs"><span style="color: #bbb;font-size: 12px; float: right;"><i class="layui-icon layui-icon-reply-fill" style="font-size: 20px; margin-right: 5px;"></i>回复</span></a> {else}<span style="color: #bbb;font-size: 12px; float: right;">贡献{volist name="$item->answers()->limit(3)->select()" id="vars"}<a href="{:url('wendasns/home/index',['id'=>$vars.user_id],false)}" class="pportrait-xs">{:portrait($vars.user_id)}</a>{/volist}</span>{/if}
                	
              </div>
                    </div>
                  </section>
                {/volist}
                <div class="pager">{$logs->render()|raw}</div>
                  
              </div>
              
              </div> 
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <div class="layui-col-md3">
    
      {include file="common/right"}
      
    </div>
  </div>
</div>
{include file="common/footer"}
{:hook('question_list_bottom_extra')}
</body>
</html>